﻿<%@ Page Title="Wild2" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Wild2.Models.Pages.User.Index>" %>
<asp:Content ID="TitleContent" ContentPlaceHolderID="TitleContent" runat="server">
    <%= Resources.Home.Title %>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HeaderBlockContent" runat="server">
<%--Keywords--%>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderContent" runat="server">
    <%  String version = "pda"; if (Session[Wild2.Models.Constants.SessionConstants.VERSION] != null) version = Session[Wild2.Models.Constants.SessionConstants.VERSION].ToString(); %>
    <% Html.RenderPartial("~/Views/Shared/" + version + "/Header.ascx", "Анкета: " + HttpUtility.HtmlEncode(Model.UserData.Nick) + ((Model.isOnline)?(" [Online]"):(""))); %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%  String version = "pda"; if (Session[Wild2.Models.Constants.SessionConstants.VERSION] != null) version = Session[Wild2.Models.Constants.SessionConstants.VERSION].ToString(); %>
    <% if (!String.IsNullOrEmpty(Model.infoMessage))
       {
           Html.RenderPartial("~/Views/Shared/" + version + "/InfoBox.ascx", Model.infoMessage);
       } %>
       <div class="container">
    <% 
        Html.RenderPartial("~/Views/Shared/" + version + "/Panel.ascx", ((Model.UserData.isMale.HasValue) ? ((Model.UserData.isMale.Value) ? ("Парень") : ("Девушка")) : ("Пользователь")) + ((Model.UserData.Address.ToLower() != "не указан") ? (" из " + HttpUtility.HtmlEncode(Model.UserData.Address)) : ("")));
        if (Model.isAvatar) Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", "Аватар");
        Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", "Рейтинг: " + Html.ActionLink("-", "Vote", new { user = Model.UserData.ID, vote = -1, hash = Wild2.Models.Auth.AuthOnSite.GetSessionHash() }, new { @class = "vote_button" }) + " <b>" + Html.ActionLink(Model.UserData.Rating.ToString(), "Index", new { id = Model.UserData.ID, votes = "full" }, new { }) + "</b> " + Html.ActionLink("+", "Vote", new { user = Model.UserData.ID, vote = 1, hash = Wild2.Models.Auth.AuthOnSite.GetSessionHash() }, new { @class = "vote_button" }));
        if (Model.Votes != null)
        {
                %>
                Проголосовали за:
                <%
            foreach (var vote in Model.Votes)
            {
                if (vote.Vote > 0)
                {
                        %>
                            <%= HttpUtility.HtmlEncode(vote.UserNick)%>
                        <%
                }
            }   
                %>
                <br />Проголосовали против:
                <%
            foreach (var vote in Model.Votes)
            {
                if (vote.Vote < 0)
                {
                        %>
                            <%= HttpUtility.HtmlEncode(vote.UserNick)%>
                        <%
                }
            }
        }
        Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", "Последний раз был " + Wild2.Models.Text.Helper.GetDateDiff(Model.UserData.LastOnlineDate) + "<br />С нами с " + Model.UserData.RegDate.ToShortDateString());
        if (Model.UserData.Birth.HasValue) Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", "День рождения " + Model.UserData.Birth.Value.ToShortDateString());
        Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", Html.ActionLink("Подписчики", "Subscr"));
        if (Model.isSubscribed.HasValue)
        {
            
            Html.BeginForm(); %>
        <div class="elb" style="padding: 0.4em">
            <input name="subscr" style="background-color: #7394BC; border-top: 1px solid #7E8FA9; border-left: 1px solid #7E8FA9;
                border-bottom: 1px solid #4C6F97; border-right: 1px solid #4C6F97; color: #FFFFFF"
                type="submit" value="<%= (Model.isSubscribed.Value == true)?"Отписаться":"Подписаться" %>" />
        </div>
        <% Html.EndForm();
        }
        Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", "Написал:<br />" + Html.ActionLink(Model.UserData.CountTopics + " тем", "User", "Blog", new { id = Model.UserData.ID }, new { }) + " и " + Model.UserData.CountComments + " комментария");
        %>
        </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="FooterContent" runat="server">
    <%  String version = "pda"; if (Session[Wild2.Models.Constants.SessionConstants.VERSION] != null) version = Session[Wild2.Models.Constants.SessionConstants.VERSION].ToString(); %>
    <% Html.RenderPartial("~/Views/Shared/" + version + "/Footer.ascx");
        %>
</asp:Content>